home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / FP_SEG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  318 b   |  15 lines

  1. #include <stdio.h>
  2. #include <dos.h>
  3. char sample[] = "Test string";
  4. main()
  5. {
  6.     void far *ps;
  7.     unsigned seg_sample;
  8. /* Cast the address of the first character as a far pointer */
  9.     ps = (void far *)sample;
  10.     seg_sample = FP_SEG(ps);
  11.     printf("The segment address of the string is: %x\n",
  12.                     seg_sample);
  13. }
  14.  
  15.